var mapIds = [993122500];
var 准备地图 = 993122800;

function init() {}

function setup(e, b) {
    var a = [9300443, 9300446, 9300447, 9300888];
    em.setProperty("state", 1);
    em.setProperty("leader", "true");
    var e = em.newInstance("荣耀活动_激战海洋");
    for (var d = 0; d < mapIds.length; d++) {
        var f = e.setInstanceMap(mapIds[d]);
        f.resetFully();
        for (var c = 0; c < a.length; c++) {
            for (var d = 0; d < 100; d++) {
                f.spawnMonsterOnGroundBelow(em.getMonster(a[c]), new java.awt.Point(e.rand(f.getLeft(), f.getRight()), e.rand(f.getTop(), f.getBottom() - 200)))
            }
        }
    }
    e.schedule("道具", 30 * 1000);
    return e
}

function 道具(b) {
    var c = b.getMapInstance(0);
    for (var a = 3; a <= 8; a++) {
        c.spawnAutoDrop_qipao(b.rand(2023866, 2023869), new java.awt.Point(b.rand(c.getLeft() + 100, c.getRight() - 100), b.rand(c.getTop() + 100, c.getBottom() - 200)))
    }
    b.schedule("道具", 30 * 1000)
}

function onPlayerRegistered(c, b) {
    b.setReviveCount(-100);
    var d = c.getMapInstance(0);
    b.changeMap(d, d.getPortal(0));
    var a = c.rand(0, 2);
    b.getAPI().setNumberForQuestInfo(43609, "color", a);
    b.getAPI().addNumberForQuestInfo(500824, "count", 1);
    b.getAPI().gloryRagingSeaStartFight();
    b.getAPI().onActionBarResult(5, 46);
    b.getAPI().gainSkillBuff(80002826 + a);
    b.getAPI().gainSkillBuff(80002850);
    b.getAPI().execCommand("enter_993122500");
    b.getAPI().execCommand("Name[enter_993122500]");
    c.showClockEffect(b, 3 * 60, false)
}

function onPlayerRevived(b, a) {
    return false
}

function onMapChanged(c, b, a) {
    em.setProperty("kill", "0");
    em.setProperty("level", "0");
    em.setProperty("clear", "0");
    em.setProperty("curMap", a);
    if (mapIds.indexOf(a) < 0) {
        on玩家退场(c, b, false);
        return
    }
}

function onPlayerDisconnected(b, a) {
    on玩家退场(b, a, false);
    return 0
}

function onMonsterDamaged(b, a, d, e, c) {}

function onTimeOut(a) {
    a.getPlayers().forEach(function (b) {
        on玩家退场(a, b, true)
    })
}

function onMonsterKilled(b, d, c) {
    var a = em.getNumberProperty("kill") + 1;
    em.setProperty("kill", a);
    player.getAPI().addNumberForQuestInfo(100351, "kill", 1)
}

function onPartyDisbanded(a) {}

function onPlayerKilled(b, a) {}
var setupTask;

function randomNum(b, a) {
    switch (arguments.length) {
        case 1:
            return parseInt(Math.random() * b + 1, 10);
            break;
        case 2:
            return parseInt(Math.random() * (a - b + 1) + b, 10);
            break;
        default:
            return 0;
            break
    }
}

function initProp(a, b) {
    if (em.getProperty(a) == null) {
        em.setProperty(a, b)
    }
}

function initPropArray(a, d, c, e) {
    for (var b = c; b <= e; b++) {
        if (em.getProperty(a + "_" + b) == null) {
            em.setProperty(a + "_" + b, d)
        }
    }
}

function on玩家退场(c, b, a) {
    b.getAPI().onActionBarResult(6, 46);
    c.disposeIfPlayerBelow(a ? 999 : 0, 准备地图);
    em.getProperties().clear();
    em.setProperty("state", 0);
    em.setProperty("leader", "true");
    c.unregisterPlayer(b)
}

function onItemPickedUp(b, a, c) {};